home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume24 / rcs / patch1 < prev    next >
Encoding:
Internet Message Format  |  1991-03-05  |  10.3 KB

  1. Subject:  v24i013:  RCS source control system, Patch1
  2. Newsgroups: comp.sources.unix
  3. Approved: rsalz@uunet.UU.NET
  4. X-Checksum-Snefru: fa066b6b 4bf25843 4ed1a085 922c2807
  5.  
  6. Submitted-by: Paul Eggert <eggert@twinsun.com>
  7. Posting-number: Volume 24, Issue 13
  8. Archive-name: rcs/patch1
  9.  
  10. In the distribution of RCS 5.5 in comp.sources.unix, the file src/rcstest
  11. is missing.  (This file is mentioned in README and src/Makefile.)
  12.  
  13. Also, PACKNOTES mentions the wrong extension for rcs.ms.*, and doesn't
  14. mention that COPYING should be linked to src/COPYING.
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then feed it
  18. # into a shell via "sh file" or similar.  To overwrite existing files,
  19. # type "sh file -c".
  20. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  21. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  22. # Contents:  PACKNOTES src/rcstest
  23. # Wrapped by rsalz@litchi.bbn.com on Mon Feb 25 15:58:19 1991
  24. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  25. echo If this archive is complete, you will see the following message:
  26. echo '          "shar: End of archive."'
  27. if test -f 'PACKNOTES' -a "${1}" != "-c" ; then 
  28.   echo shar: Will not clobber existing file \"'PACKNOTES'\"
  29. else
  30.   echo shar: Extracting \"'PACKNOTES'\" \(162 characters\)
  31.   sed "s/^X//" >'PACKNOTES' <<'END_OF_FILE'
  32. X# "rcs.ms" was split into 2 parts; to create it, do
  33. X    cat rcs.ms.* >rcs.ms
  34. X# "src/COPYING" should be a copy of "COPYING"; to create it, do
  35. X    ln COPYING src/COPYING
  36. END_OF_FILE
  37.   if test 162 -ne `wc -c <'PACKNOTES'`; then
  38.     echo shar: \"'PACKNOTES'\" unpacked with wrong size!
  39.   fi
  40.   # end of 'PACKNOTES'
  41. fi
  42. if test -f 'src/rcstest' -a "${1}" != "-c" ; then 
  43.   echo shar: Will not clobber existing file \"'src/rcstest'\"
  44. else
  45.   echo shar: Extracting \"'src/rcstest'\" \(8157 characters\)
  46.   sed "s/^X//" >'src/rcstest' <<'END_OF_FILE'
  47. X#!/bin/sh
  48. X
  49. X# Test RCS's functions.
  50. X
  51. X# Test RCS by creating files a.* and a.c,v (or RCS/a.c,v).
  52. X# If all goes well, output nothing, and remove the temporary files.
  53. X# Otherwise, send a message to standard output.
  54. X# Exit status is 0 if OK, 1 if an RCS bug is found, and 2 if scaffolding fails.
  55. X# With the -v option, output more debugging info.
  56. X
  57. X# If diff outputs `No differences encountered' when comparing identical files,
  58. X# then rcstest may also output these noise lines; ignore them.
  59. X
  60. X# The current directory must be readable, writable, and searchable,
  61. X# and similarly for ./RCS if it exists.
  62. X# The RCS commands are searched for in the PATH as usual.
  63. X
  64. X#    $Id: rcstest,v 5.3 1990/09/20 02:38:57 eggert Exp $
  65. X
  66. X
  67. X#    Copyright 1990 by Paul Eggert
  68. X#    Distributed under license by the Free Software Foundation, Inc.
  69. X#
  70. X# This file is part of RCS.
  71. X#
  72. X# RCS is free software; you can redistribute it and/or modify
  73. X# it under the terms of the GNU General Public License as published by
  74. X# the Free Software Foundation; either version 1, or (at your option)
  75. X# any later version.
  76. X#
  77. X# RCS is distributed in the hope that it will be useful,
  78. X# but WITHOUT ANY WARRANTY; without even the implied warranty of
  79. X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  80. X# GNU General Public License for more details.
  81. X#
  82. X# You should have received a copy of the GNU General Public License
  83. X# along with RCS; see the file COPYING.  If not, write to
  84. X# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  85. X#
  86. X# Report problems and direct all questions to:
  87. X#
  88. X#     rcs-bugs@cs.purdue.edu
  89. X
  90. Xcase $1 in
  91. X-v) q=; set -x;;
  92. X'') q=-q;;
  93. X*) echo >&2 "$0: usage: $0 [-v]"; exit 2
  94. Xesac
  95. X
  96. Xif test -d RCS
  97. Xthen R=RCS/
  98. Xelse R=
  99. Xfi
  100. X
  101. Xrm -f a.* ${R}a.c,v &&
  102. Xecho 1.1 >a.11 &&
  103. Xecho 1.1.1.1 >a.1111 &&
  104. Xecho 1.2 >a.12 &&
  105. Xrm -f a.c ${R}a.c,v || { echo "#initialization failed"; exit 1; }
  106. X
  107. Xrcs -i -L -ta.11 $q a.c &&
  108. X<${R}a.c,v || { echo "#rcs -i -L failed"; exit 1; }
  109. X
  110. Xrlog a.c >/dev/null || { echo "#rlog failed on empty RCS file"; exit 1; }
  111. Xrm -f ${R}a.c,v || exit 2
  112. X
  113. Xcp a.11 a.c &&
  114. Xci -ta.11 -mm $q a.c &&
  115. X<${R}a.c,v &&
  116. Xrcs -L $q a.c || { echo "#ci+rcs -L failed"; exit 1; }
  117. Xtest ! -f a.c || { echo "#ci did not remove working file"; exit 1; }
  118. Xfor l in '' '-l'
  119. Xdo
  120. X    co $l $q a.c &&
  121. X    test -f a.c || { echo '#co' $l did not create working file; exit 1; }
  122. X    diff -c a.11 a.c || { echo '#ci' followed by co $l is not a no-op; exit 1; }
  123. Xdone
  124. X
  125. Xcp a.12 a.c &&
  126. Xci -mm $q a.c &&
  127. Xco $q a.c &&
  128. Xdiff -c a.12 a.c || { echo "#ci+co failed"; exit 1; }
  129. X
  130. Xco -r1.1 $q a.c &&
  131. Xdiff -c a.11 a.c || { echo "#can't retrieve first revision"; exit 1; }
  132. X
  133. Xrm -f a.c &&
  134. Xcp a.1111 a.c &&
  135. Xci -r1.1.1 -mm $q a.c &&
  136. Xco -r1.1.1.1 $q a.c &&
  137. Xdiff -c a.1111 a.c || { echo "#branches failed"; exit 1; }
  138. X
  139. Xco -l $q a.c &&
  140. Xci -f -mm $q a.c &&
  141. Xco -r1.3 $q a.c &&
  142. Xdiff -c a.12 a.c || { echo "#(co -l; ci -f) failed"; exit 1; }
  143. X
  144. Xco -l $q a.c &&
  145. Xecho 1.4 >a.c &&
  146. Xci -l -mm $q a.c &&
  147. Xecho error >a.c &&
  148. Xci -mm $q a.c || { echo "#ci -l failed"; exit 1; }
  149. X
  150. Xco -l $q a.c &&
  151. Xecho 1.5 >a.c &&
  152. Xci -u -mm $q a.c &&
  153. X<a.c || { echo "#ci -u didn't create a working file"; exit 1; }
  154. Xrm -f a.c &&
  155. Xecho error >a.c || exit 2
  156. Xci -mm $q a.c 2>/dev/null && { echo "#ci -u didn't unlock the file"; exit 1; }
  157. X
  158. Xrm -f a.c &&
  159. Xrcs -l $q a.c &&
  160. Xco -u $q a.c || { echo "#rcs -l + co -u failed"; exit 1; }
  161. Xrm -f a.c &&
  162. Xecho error >a.c || exit 2
  163. Xci -mm $q a.c 2>/dev/null && { echo "#co -u didn't unlock the file"; exit 1; }
  164. X
  165. Xrm -f a.c &&
  166. Xcp a.11 a.c &&
  167. Xco -f $q a.c || { echo "#co -f failed"; exit 1; }
  168. Xdiff -c a.11 a.c >/dev/null && { echo "#co -f had no effect"; exit 1; }
  169. X
  170. Xco -p1.1 $q a.c >a.t &&
  171. Xdiff -c a.11 a.t || { echo "#co -p failed"; exit 1; }
  172. X
  173. Xfor n in n N
  174. Xdo
  175. X    rm -f a.c &&
  176. X    co -l $q a.c &&
  177. X    echo $n >a.$n &&
  178. X    cp a.$n a.c &&
  179. X    ci -${n}n -mm $q a.c &&
  180. X    co -rn $q a.c &&
  181. X    diff -c a.$n a.c || { echo "#ci -$n failed"; exit 1; }
  182. Xdone
  183. X
  184. Xme=${LOGNAME-${USER-`who am i | sed 's/ .*//; s/.*!//'`}} || exit 2
  185. Xdate=`date -u 2>/dev/null || TZ=GMT date` || exit 2
  186. Xset $date
  187. Xcase $2 in
  188. XJan) m=01;; Feb) m=02;; Mar) m=03;; Apr) m=04;; May) m=05;; Jun) m=06;;
  189. XJul) m=07;; Aug) m=08;; Sep) m=09;; Oct) m=10;; Nov) m=11;; Dec) m=12;;
  190. X*) echo >&2 "$0: $2: unknown month name"; exit 2
  191. Xesac
  192. Xcase $3 in
  193. X?) d=0$3;;
  194. X*) d=$3
  195. Xesac
  196. XD=$6/$m/$d
  197. XT=$4
  198. X: ${PWD=`pwd`} &&
  199. Xco -l $q a.c &&
  200. Xsed 's/@/$/g' <<EOF >a.kv &&
  201. X@Author: w @
  202. X@Date: $D $T @
  203. X@Header: $PWD/${R}a.c,v 2.1 $D $T w s @
  204. X@Id: a.c,v 2.1 $D $T w s @
  205. X@Locker:  @
  206. X@Log: a.c,v @
  207. X * Revision 2.1  $D  $T  w
  208. X * m
  209. X *
  210. X@RCSfile: a.c,v @
  211. X@Revision: 2.1 @
  212. X@Source: $PWD/${R}a.c,v @
  213. X@State: s @
  214. XEOF
  215. Xsed 's/:.*\$/$/' a.kv >a.k &&
  216. Xsed 's/w s \$$/w s '"$me"' $/; s/[$]Locker: /&'"$me/" a.kv >a.kvl &&
  217. Xsed '/^\$/!d; s/\$$/: old $/' a.k >a.o &&
  218. Xsed 's/\$[^ ]*: //; s/ \$//' a.kv >a.v &&
  219. Xcp a.o a.c &&
  220. Xci -d"$date" -ss -ww -u2.1 -mm $q a.c &&
  221. Xdiff -c a.kv a.c || { echo "#keyword expansion failed"; exit 1; }
  222. Xco -p -ko $q a.c >a.oo &&
  223. Xdiff -c a.o a.oo || { echo "#co -p -ko failed"; exit 1; }
  224. Xcp a.kv a.o || exit 2
  225. Xrcs -o2.1 $q a.c &&
  226. Xrcs -l $q a.c &&
  227. Xci -k -u $q a.c &&
  228. Xdiff -c a.kv a.c || { echo "#ci -k failed"; exit 1; }
  229. Xsed '/^[^$]/d' a.kv >a.i &&
  230. Xident a.c >a.i1 &&
  231. Xsed '1d; s/^[     ]*//' a.i1 >a.i2 &&
  232. Xdiff -c a.i a.i2 || { echo "#ident failed"; exit 1; }
  233. X
  234. Xrcs -i $q a.c 2>/dev/null && { echo "#rcs -i permitted existing file"; exit 1; }
  235. X
  236. Xco -l $q a.c &&
  237. Xecho 2.2 >a.c &&
  238. Xci -mm $q a.c &&
  239. Xecho 1.1.1.2 >a.c &&
  240. Xrcs -l1.1.1 $q a.c &&
  241. Xci -r1.1.1.2 -mm $q a.c &&
  242. Xrcs -b1.1.1 $q a.c &&
  243. Xtest " `co -p $q a.c`" = ' 1.1.1.2' || { echo "#rcs -b1.1.1 failed"; exit 1; }
  244. Xrcs -b $q a.c &&
  245. Xtest " `co -p $q a.c`" = ' 2.2' || { echo "#rcs -b failed"; exit 1; }
  246. X
  247. Xecho 2.3 >a.c || exit 2
  248. Xrcs -U $q a.c || { echo "#rcs -U failed"; exit 1; }
  249. Xci -mm $q a.c || { echo "#rcs -U didn't unset strict locking"; exit 1; }
  250. Xrcs -L $q a.c || { echo "#rcs -L failed"; exit 1; }
  251. Xecho error >a.c || exit 2
  252. Xci -mm $q a.c 2>/dev/null && { echo "#ci retest failed"; exit 1; }
  253. X
  254. Xrm -f a.c &&
  255. Xrcs -nN:1.1 $q a.c &&
  256. Xco -rN $q a.c &&
  257. Xdiff -c a.11 a.c || { echo "#rcs -n failed"; exit 1; }
  258. X
  259. Xrcs -NN:2.1 $q a.c &&
  260. Xco -rN $q a.c &&
  261. Xdiff -c a.kv a.c || { echo "#rcs -N failed"; exit 1; }
  262. X
  263. Xco -l $q a.c &&
  264. Xrcs -c':::' $q a.c &&
  265. Xecho '$''Log$' >a.c &&
  266. Xci -u -mm $q a.c &&
  267. Xtest " `sed '$!d' a.c`" = ' :::' || { echo "#rcs -c failed"; exit 1; }
  268. X
  269. Xrcs -o2.2- $q a.c &&
  270. Xco $q a.c &&
  271. Xdiff -c a.kv a.c || { echo "#rcs -o failed"; exit 1; }
  272. X
  273. Xrcsdiff -r1.1 -r2.1 $q a.c >a.0
  274. Xcase $? in 1) ;; *) echo "#rcsdiff bad status"; exit 1; esac
  275. Xdiff a.11 a.kv >a.1
  276. Xdiff a.0 a.1 || { echo "#rcsdiff failed"; exit 1; }
  277. X
  278. Xrcs -l2.1 $q a.c || { echo "#rcs -l2.1 failed"; exit 1; }
  279. Xfor i in k kv kvl o v
  280. Xdo
  281. X    rm -f a.c &&
  282. X    cp a.$i a.c &&
  283. X    rcsdiff -k$i -c $q a.c || { echo "#rcsdiff -k$i failed"; exit 1; }
  284. Xdone
  285. Xco -p1.1 -ko $q a.c >a.t &&
  286. Xdiff -c a.11 a.t || { echo "#co -p1.1 -ko failed"; exit 1; }
  287. Xrcs -u2.1 $q a.c || { echo "#rcs -u2.1 failed"; exit 1; }
  288. X
  289. Xrm -f a.c &&
  290. Xco -l $q a.c &&
  291. Xcat >a.c <<'EOF' &&
  292. X2.2
  293. Xa
  294. Xb
  295. Xc
  296. Xd
  297. XEOF
  298. Xci -l -mm $q a.c &&
  299. Xco -p2.2 $q a.c | sed 's/2.2/2.3/; s/b/b1/' >a.c &&
  300. Xci -l -mm $q a.c &&
  301. Xco -p2.2 $q a.c | sed 's/2.2/new/; s/d/d1/' >a.c || exit 2
  302. Xrcsmerge -r2.2 -r2.3 $q a.c
  303. Xcase $? in
  304. X1) ;;
  305. X*) echo "#rcsmerge bad status"; exit 1
  306. Xesac
  307. Xdiff -c - a.c <<'EOF' || { echo "#rcsmerge failed"; exit 1; }
  308. X<<<<<<< a.c
  309. Xnew
  310. X=======
  311. X2.3
  312. X>>>>>>> 2.3
  313. Xa
  314. Xb1
  315. Xc
  316. Xd1
  317. XEOF
  318. X
  319. Xnl='
  320. X'
  321. Xif
  322. X    co -p $q a.c | tr "$nl" "/" >a.c &&
  323. X    ci -mm $q a.c
  324. Xthen
  325. X    co -p $q a.c | tr "/" "$nl" >a.c &&
  326. X    rcsdiff -c -r2.3 $q a.c || { echo "#trailing newline test failed"; exit 1; }
  327. Xelse
  328. X    echo "#warning: Traditional diff is used, so RCS is limited to text files."
  329. X    echo 'Keep rlog test happy.' >a.c && ci -mm $q a.c || exit
  330. Xfi
  331. X
  332. Xrlog -r2.1 a.c >a.t &&
  333. Xgrep '^checked in with -k' a.t >/dev/null &&
  334. Xsed '/^checked in with -k/d' a.t >a.u &&
  335. Xdiff -c - a.u <<EOF || { echo "#rlog failed"; exit 1; }
  336. X
  337. XRCS file: ${R}a.c,v
  338. XWorking file: a.c
  339. Xhead: 2.4
  340. Xbranch:
  341. Xlocks: strict
  342. Xaccess list:
  343. Xsymbolic names:
  344. X    N: 2.1
  345. X    n: 1.8
  346. Xcomment leader: ":::"
  347. Xkeyword substitution: kv
  348. Xtotal revisions: 14;    selected revisions: 1
  349. Xdescription:
  350. X1.1
  351. X----------------------------
  352. Xrevision 2.1
  353. Xdate: $D $T;  author: w;  state: s;  lines: +13 -1
  354. X=============================================================================
  355. XEOF
  356. X
  357. X
  358. Xexec rm -f a.* ${R}a.c,v
  359. X
  360. END_OF_FILE
  361.   if test 8157 -ne `wc -c <'src/rcstest'`; then
  362.     echo shar: \"'src/rcstest'\" unpacked with wrong size!
  363.   fi
  364.   chmod +x 'src/rcstest'
  365.   # end of 'src/rcstest'
  366. fi
  367. echo shar: End of archive.
  368. exit 0
  369. exit 0 # Just in case...
  370.